#include <iostream>
using namespace std;

bool isprime(int num)
{
    for (int j = 2; j <= num; j++)
    {
        if (num == j)
        {
            return true;
            // break;
        }
        if (num % j == 0)
            break;
    }
    return false;
}

int main()
{
    cout << endl
         << "学号：3170608043，姓名：石英钰" << endl
         << endl;
    cout << "Features: 输入任一个正整数x，输出6到该数范围内的各个满足条件的组合(任何大于2的偶数均可表示为两个素数的和)" << endl
         << endl;

    cout << "输入任一个正整数x: ";
    int x;
    cin >> x;

    if (x <= 6)
    {
        cout << "输入的数小于6, 结束程序" << endl;
        return 1;
    }

    int j = 0, count = 0;
    for (int i = 6; i < x / 2; i++)
    {
        j = x - i;
        // cout << i << j << endl;
        if (isprime(i) && isprime(j))
        {
            count++;
            printf("组合%d: %d and %d\n", count, i, j);
        }
    }

    if (count == 0)
    {
        cout << "6到该数范围内没有满足条件的组合." << endl;
    }
    return 0;
}